<template>
  <div class="page-header-index-wide">
    <!-- <a-card
      :bordered="false"
      :bodyStyle="{ padding: '16px', height: '100%' }"
      :style="{ height: '100%' }"
    > -->
      <div>
        <div class="account-settings-info-left">
          <a-menu
            mode="horizontal"
            :selectedKeys="selectedKeys"
            type="inner"
            style="padding:8px 16px 0;"
            @openChange="onOpenChange"
          >
            <a-menu-item key="/setting/rulesExpand/festival" class="border-cantainer">
              <router-link :to="{ name: 'festival_rules' }">
                <div class="border_catainer_bottom">节假日设置</div>
              </router-link>
            </a-menu-item>
            <a-menu-item key="/setting/rulesExpand/students" class="border-cantainer">
              <router-link :to="{ name: 'students_rules' }">
                <div class="border_catainer_bottom">学员信息</div>
              </router-link>
            </a-menu-item>
            <a-menu-item key="/setting/rulesExpand/parentsClient" class="border-cantainer">
              <router-link :to="{ name: 'parents_client' }">
                <div class="border_catainer_bottom">家长端管理</div>
              </router-link>
            </a-menu-item>
            <a-menu-item key="/setting/rulesExpand/shareTemplate" class="border-cantainer">
              <router-link :to="{ name: 'share_template' }">
                <div class="border_catainer_bottom">分享链接模板</div>
              </router-link>
            </a-menu-item>
            <!-- <a-menu-item key="/setting/rulesExpand/teacherClient" class="border-cantainer">
              <router-link :to="{ name: 'teacher_client' }">
                <div class="border_catainer_bottom">老师端管理</div>
              </router-link>
            </a-menu-item> -->
            <a-menu-item key="/setting/rulesExpand/receiptPrint" class="border-cantainer">
              <router-link :to="{ name: 'receipt_print' }">
                <div class="border_catainer_bottom">收据打印</div>
              </router-link>
            </a-menu-item>
            <a-menu-item key="/setting/rulesExpand/config" class="border-cantainer">
              <router-link :to="{ name: 'company_config' }">
                <div class="border_catainer_bottom">机构设置</div>
              </router-link>
            </a-menu-item>
          </a-menu>
        </div>
        <div class="account-settings-info-right">
          <!-- <div class="account-settings-info-title"> -->
          <!-- <span>{{ $route.meta.title }}</span> -->
          <!-- </div> -->
          <route-view></route-view>
        </div>
      </div>
    <!-- </a-card> -->
  </div>
</template>

<script>
import { PageView, RouteView } from '@/layouts'
import { mixinDevice } from '@/utils/mixin.js'

export default {
  components: {
    RouteView,
    PageView
  },
  mixins: [mixinDevice],
  data() {
    return {
      // horizontal  inline
      mode: 'inline',

      openKeys: [],
      selectedKeys: [],

      // cropper
      preview: {},
      option: {
        img: '/avatar2.jpg',
        info: true,
        size: 1,
        outputType: 'jpeg',
        canScale: false,
        autoCrop: true,
        // 只有自动截图开启 宽度高度才生效
        autoCropWidth: 180,
        autoCropHeight: 180,
        fixedBox: true,
        // 开启宽度和高度比例
        fixed: true,
        fixedNumber: [1, 1]
      },

      pageTitle: ''
    }
  },
  mounted() {
    this.updateMenu()
  },
  methods: {
    onOpenChange(openKeys) {
      this.openKeys = openKeys
    },
    updateMenu() {
      const routes = this.$route.matched.concat()
      this.selectedKeys = [routes.pop().path]
    }
  },
  watch: {
    $route(val) {
      this.updateMenu()
    }
  }
}
</script>

<style lang="less" scoped>
.border-cantainer {
  padding: 0 10px;
  margin-right: 40px;
}
</style>
